#include "../../../portable/arch/arm/arm-v7m/common/tos_cpu.c"
#include "../../../portable/arch/arm/arm-v7m/common/tos_fault.c"

#ifndef __CORTEX_M
#pragma GCC error "no \"__CORTEX_M\" definition"
#endif

#if (__CORTEX_M == 0x00U)
#include "../portable/arch/arm/arm-v7m/cortex-m0+/gcc/port_c.c"
#endif

#if (__CORTEX_M == 0x03U)
#include "../portable/arch/arm/arm-v7m/cortex-m3/gcc/port_c.c"
#endif

#if (__CORTEX_M == 0x04U)
#include "../portable/arch/arm/arm-v7m/cortex-m4/gcc/port_c.c"
#endif

#if (__CORTEX_M == 0x07U)
#include "../portable/arch/arm/arm-v7m/cortex-m7/gcc/port_c.c"
#endif

void osSystickHandler() {
  if (tos_knl_is_running()) {
      tos_knl_irq_enter();
      tos_tick_handler();
      tos_knl_irq_leave();
  }
}